<template>
  <div>
    <el-dialog title="设置合伙人等级" :visible.sync="dialogVisible" width="400px">
      <el-select v-model="queryParams.level" placeholder="请选择">
        <el-option label="1级合伙人" :value="1" />
        <el-option label="2级合伙人" :value="2" />
        <el-option label="3级合伙人" :value="3" />
        <el-option label="4级合伙人" :value="4" />
        <el-option label="5级合伙人" :value="5" />
        <el-option label="6级合伙人" :value="6" />
        <el-option label="7级合伙人" :value="7" />
        <el-option label="8级合伙人" :value="8" />
        <el-option label="9级合伙人" :value="9" />
        <el-option label="10级合伙人" :value="10" />

      </el-select>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="confirm">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { setPartnerLevel } from '@/api/table'
export default {
  components: {
  },
  data() {
    return {
      dialogVisible: false,
      listLoading: true,
      total: 0,
      queryParams: {
        level: '',
        userId: ''
      },
      list: [],
      record: {}

    }
  },
  created() {

  },
  methods: {

    async show(record) {
      this.dialogVisible = true
      this.queryParams.userId = record.id
      this.queryParams.level = record.partnerLevel
    },
    confirm() {
      this.$confirm('是否确认?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        setPartnerLevel(this.queryParams).then(res => {
          this.dialogVisible = false
          this.$parent.fetchData()
          this.$message({
            message: '操作成功',
            type: 'success'
          })
        })
      })
    }

  }
}
</script>
<style scoped lang="scss">
.el-tag+.el-tag {
  margin-left: 10px;
}

.button-new-tag {
  margin-left: 10px;
  height: 32px;
  line-height: 30px;
  padding-top: 0;
  padding-bottom: 0;
}

.input-new-tag {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;
}

.list {
  .item {
    border: 1px solid #c0ccda;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-top: 10px;

    >div {
      display: flex;

      img {
        margin-right: 15px;
      }
    }

    >i {
      font-size: 20px;
      cursor: pointer;
    }
  }
}
</style>
